package com.huluobo.mvvm_base.model;

import com.huluobo.mvvm_base.db.AppDBUtils;
import com.huluobo.mvvm_base.db.MoneyDao;
import com.huluobo.mvvm_base.db.UserDao;
import com.huluobo.mvvm_base.db.VideoDao;
import com.huluobo.mvvm_base.net.ApiService;
import com.huluobo.mvvm_base.net.RetrofitManager;

/**
 * Created by LC on 2024/3/22.
 * 所有的Model层在MVVM模式中由于名字重复,所以都改为叫做Repository(仓库),简称Repo
 * 只要继承当前的Repo就可以使用受保护的(protected)apiService,并且apiService在继承实例的过程中已经实例化了
 */
public class BaseRepo {
    protected ApiService apiService;

    protected MoneyDao moneyDao;

    protected UserDao userDao;

    protected VideoDao videoDao;

    public BaseRepo() {
        apiService = RetrofitManager.getInstance().getRetrofit().create(ApiService.class);
        moneyDao = AppDBUtils.getInstance().getMoneyDao();
        userDao = AppDBUtils.getInstance().getUserDao();
        videoDao = AppDBUtils.getInstance().getVideoDao();
    }
}
